<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%--引用标签--%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<%@ include file="/WEB-INF/include/head.basic.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Jedit测试</title>
<link href="<c:url value='/css/weibostyle.css'/>" rel="stylesheet" type="text/css">
</head>
<body>
<div id="page">
<div id="header">
<a href="/"><img style="border:none" src="<c:url value='/images/weibologo.png'/>" width="192" height="85" alt="Retwis"></a>
<div id="navbar">
<a href="index.php">主页</a>
| <a href="./timeline">热点</a>

| <a href="logout.php">退出</a>

</div>
</div>
<h2 class="username">${userInfo.username}</h2>
<c:choose>
	<c:when test="${isFollow == true}">
		<a href="follow?uid=${userInfo.userId}&username=${userInfo.username}&isFollow=1" class="button">取消关注</a>
	</c:when>
	<c:otherwise>
		<a href="follow?uid=${userInfo.userId}&username=${userInfo.username}&isFollow=0" class="button">关注ta</a>	
	</c:otherwise>
</c:choose>
<c:forEach items="${postInfos}" var="bean">
	<div class="post">
		<a class="username" href="profile?username=${bean.username}">${bean.username}</a> ${bean.content}<br>
		<i>
			<script>
				if(('${bean.time}'/1000)< 60){
					 document.write(parseInt('${bean.time}'/1000)+"秒前通过 web发布");
				}else if(('${bean.time}'/60000)<60){
					document.write(parseInt('${bean.time}'/60000)+"分钟前通过 web发布");
				}else if(('${bean.time}'/3600000)<24){
					document.write(parseInt('${bean.time}'/3600000)+"小时前通过 web发布");
				}else{
					document.write(parseInt('${bean.time}'/86400000)+"天前通过 web发布");
				}
			</script>
		</i>
	</div>
</c:forEach>

<div id="footer">redis版本的仿微博项目 <a href="http://redis.io">Redis key-value database</a></div>
</div>
</body>
</html>
